import request from './request'

// 获取运动员列表
export const getAthleteList = (params) => {
  return request.get('/athlete/list', { params })
}

// 获取运动员详情
export const getAthleteDetail = (id) => {
  return request.get(`/athlete/${id}`)
}

// 创建运动员
export const createAthlete = (data) => {
  return request.post('/athlete', data)
}

// 更新运动员信息
export const updateAthlete = (id, data) => {
  return request.put(`/athlete/${id}`, data)
}

// 删除运动员
export const deleteAthlete = (id) => {
  return request.delete(`/athlete/${id}`)
}

// 批量删除运动员
export const batchDeleteAthletes = (ids) => {
  return request.delete('/athlete/batch', { data: { ids } })
}

// 启用/禁用运动员
export const toggleAthleteStatus = (id, status) => {
  return request.put(`/athlete/${id}/status`, { status })
}

// 导入运动员
export const importAthletes = (data) => {
  return request.post('/athlete/import', data)
}

// 导出运动员
export const exportAthletes = (params) => {
  return request.get('/athlete/export', { params, responseType: 'blob' })
}
